#ifndef DSP_I2C_H_
#define DSP_I2C_H_

#include "stm32f10x.h"


/******************  GPIO Config    *****************/
#define I2CX_GPIO_RCC				RCC_APB2Periph_GPIOB
#define I2CX_CLK_RCC				RCC_APB1Periph_I2C1
#define I2CX_PORT           GPIOB
#define I2CX_SDA_PIN				GPIO_Pin_7
#define I2CX_SCL_PIN				GPIO_Pin_6

#define RCC_APBX_CLOCK_RCC			RCC_APB2PeriphClockCmd

/******************  SDA   SCL    *****************/
#define SDA_H()				GPIO_SetBits(I2CX_PORT,I2CX_SDA_PIN)
#define SDA_L()				GPIO_ResetBits(I2CX_PORT,I2CX_SDA_PIN)
#define SCL_H()				GPIO_SetBits(I2CX_PORT,I2CX_SCL_PIN)
#define SCL_L()				GPIO_ResetBits(I2CX_PORT,I2CX_SCL_PIN)


void I2C_GPIO_Config(void);
void I2C_Start(void);
void I2C_Stop(void);
char I2C_WaitACK (void);
void I2C_SendByte (int8_t data);


#endif

